package com.sskj.api.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.time.LocalDateTime;

@Data
@Schema(description = "用户登录日志")
@TableName("user_login_log")
public class UserLoginLog {

    @Schema(description = "主键ID")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Schema(description = "用户ID")
    @TableField("user_id")
    private Long userId;

    @Schema(description = "用户名")
    @TableField(exist = false)
    private String username;

    @Schema(description = "登录IP")
    @TableField("login_ip")
    private String loginIp;

    @TableField("login_region")
    @Schema(description = "登录区域")
    private String loginRegion;

    @TableField("operating_system_name")
    @Schema(description = "操作系统")
    private String operatingSystemName;

    @TableField("agent_name")
    @Schema(description = "客户端")
    private String agentName;

    @TableField("login_status")
    @Schema(description = "登录状态")
    private Integer loginStatus;

    @Schema(description = "登录类型[1:账号密码]")
    @TableField("login_type")
    private Integer loginType;

    @Schema(description = "备注")
    @TableField("remarks")
    private String remarks;

    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
}
